<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
    test(() => {
        assert_not_equals(window.internals, undefined,
            'This test requires window.internals to access clipboard');
        assert_selection(
            '<div contenteditable>|a b a</div>',
            selection => {
                selection.document.execCommand('findString', false, 'a b');
                selection.document.execCommand('copy');
                selection.document.execCommand('findString', false, 'a');
                selection.document.execCommand('paste');
            },
            '<div contenteditable>a b a b|</div>');
    }, 'simulate find and replace');
</script>
